package com.deyuanyun.pic.ctrl.enumeration;

import com.deyuanyun.pic.ctrl.annotation.AutoEnum;

/**
 * 
 * @author lijun
 * @date 2016-09-07
 * 设备阴保电源运行状态
 * History:  王敏，16/09/12
 *
 *
 */


@AutoEnum(name="运行状态",method = "getVal")
public enum EqptRunningStatedEnum {
    RUNNING("运行中"),
    LEAVE_UNUSED("闲置中"),
    MAINTENANCE("维修中"),
    WRITTEN_OFF("已报废");


    private String label;

    private EqptRunningStatedEnum(String label) {
        this.label = label;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public static String getVal(String lable)
    {

        EqptRunningStatedEnum rs[]= EqptRunningStatedEnum.values();
        for(int i=0,end=rs.length;i<end;i++)
        {
            if(rs[i].getLabel().equals(lable))
            {
                return rs[i].toString();
            }
        }
        return null;
    }

    public static String getLabel(String code) {
        EqptRunningStatedEnum rs[] = EqptRunningStatedEnum.values();
        for (int i = 0; i < rs.length; i++) {
            if (rs[i].toString().equals(code)) {
                return rs[i].getLabel();
            }
        }
        return null;
    }
}
